]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screencast: Validate parameters of ScreencastArea
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 4 Nov 2013 13:09:19 +0000 (14:09 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 4 Nov 2013 15:21:45 +0000 (16:21 +0100)
... just as we do for screenshots.

https://bugzilla.gnome.org/show_bug.cgi?id=699752

js/ui/screencast.js

index 23d6a42690c466f9176e3911d33abfd9d0d908fb..7908ff166fea438fea82631d6f0914a9c1a1cfdf 100644 (file)
@@ -137,6 +137,16 @@ const ScreencastService = new Lang.Class({
         if (!recorder.is_recording()) {
             let [x, y, width, height, fileTemplate, options] = params;
 
+            if (x < 0 || y < 0 ||
+                width <= 0 || height <= 0 ||
+                x + width > global.screen_width ||
+                y + height > global.screen_height) {
+                invocation.return_error_literal(Gio.IOErrorEnum,
+                                                Gio.IOErrorEnum.CANCELLED,
+                                                "Invalid params");
+                return;
+            }
+
             recorder.set_file_template(fileTemplate);
             recorder.set_area(x, y, width, height);
             this._applyOptionalParameters(recorder, options);